import request from '@/utils/axios-req'
const SERVERURL = import.meta.env.VITE_APP_BASE_MIAN_URL
// const SERVERURL = 'http://localhost:8000'

// ### 获取下载文件列表
export const getDownloadList = ({ page, size }) => {
    return request({
      url: `${SERVERURL}/download/list?skip=${page}&limit=${size}`,
      reqLoading: false,
      method: 'get'
    })
}
// ### 获取下载文件详情
export const getDownloadDetail = (id) => {
    return request({
      url: `${SERVERURL}/download/list/${id}`,
      reqLoading: false,
      method: 'get'
    })
}
// ### 下载文件到本地
export const downloadFile = (id) => {
    return request({
      url: `${SERVERURL}/download/list/${id}/download`,
    responseType: 'blob',
      method: 'get'
    })
}

// ### 下载列表(管理员)
// GET http://127.0.0.1:8000/download/list
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzdXBlcm1hbjAxIiwiZXhwIjoxNzE1MTc1OTY1fQ.-DJGE4HxO0zEe4-OTfpZmygXaZ8h2-O31-LGqPtodSU

// ### 下载文件详情(管理员)
// GET http://127.0.0.1:8000/download/list/1
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzdXBlcm1hbjAxIiwiZXhwIjoxNzE1MTc1OTY1fQ.-DJGE4HxO0zEe4-OTfpZmygXaZ8h2-O31-LGqPtodSU

// ### 下载文件(管理员)
// GET http://127.0.0.1:8000/download/list/1/download
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzdXBlcm1hbjAxIiwiZXhwIjoxNzE1MTc1OTY1fQ.-DJGE4HxO0zEe4-OTfpZmygXaZ8h2-O31-LGqPtodSU


// ### 下载列表(用户)
// GET http://127.0.0.1:8000/download/list
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqYXkzMjIyMSIsImV4cCI6MTcxNTE3NjA5N30.d1ZwLGqAHLgbxxktiWN8vFhOUSRFQV3FK-4uuWBEfpY

// ### 下载文件详情(用户)
// GET http://127.0.0.1:8000/download/list/1
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqYXkzMjIyMSIsImV4cCI6MTcxNTE3NjA5N30.d1ZwLGqAHLgbxxktiWN8vFhOUSRFQV3FK-4uuWBEfpY

// ### 下载文件(用户)
// GET http://127.0.0.1:8000/download/list/1/download
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqYXkzMjIyMSIsImV4cCI6MTcxNTE3NjA5N30.d1ZwLGqAHLgbxxktiWN8vFhOUSRFQV3FK-4uuWBEfpY


